package com.fx.service.impl;

import cn.hutool.core.date.DateUtil;

import com.fx.entity.SysRoleRes;
import com.fx.mapper.SysRoleResMapper;
import com.fx.service.SysRoleResService;
import com.fx.util.IdWorker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @Auther: EDZ
 * @Date: 2018-5-18 11:55:11
 * @Email: 你的邮箱
 * 概要说明：该类干嘛用的
 **/
@Service
public class SysRoleResServiceImpl implements SysRoleResService {

    @Autowired
    IdWorker idWorker;
    @Autowired
    SysRoleResMapper sysRoleResMapper;


    @Override
    public List<SysRoleRes> listData(Map<String, Object> param) {
        return sysRoleResMapper.queryListData(param);
    }

    @Override
    public int getCount(Map<String, Object> param) {
        return sysRoleResMapper.queryCount(param);
    }

    @Override
    public SysRoleRes getById(String flId) {
        return sysRoleResMapper.getById(flId);
    }

    @Override
    public int save(SysRoleRes sysRoleRes) {
        sysRoleRes.setFlId(String.valueOf(idWorker.nextId()));
        sysRoleRes.setFlCreatedTime(DateUtil.now());
        return sysRoleResMapper.save(sysRoleRes);
    }

    @Override
    public int updateById(SysRoleRes sysRoleRes) {
        return sysRoleResMapper.updateById(sysRoleRes);
    }

    @Override
    public int batchDelByIds(String[] ids) {
        return sysRoleResMapper.batchRemove(ids);
    }


}
